Skip to content

Comments

fix(nix): Wrap package binary to isolate Python environment#220

Merged
ncrmro merged 1 commit intomainfrom
fix/wrap-pythonpath
Feb 18, 2026
Merged

fix(nix): Wrap package binary to isolate Python environment#220
ncrmro merged 1 commit intomainfrom
fix/wrap-pythonpath

Conversation

@ncrmro
Copy link
Collaborator

@ncrmro ncrmro commented Feb 18, 2026

When consumed as a buildInput in another flake's devShell, other Python-based packages (azure-cli, awscli2, pipx) pollute PYTHONPATH with python3.13 site-packages. deepwork's python3.11 interpreter then loads incompatible native extensions (e.g. cryptography built for 3.13), causing "undefined symbol: PyErr_GetRaisedException" on MCP server start.

Wrap the deepwork binary with makeWrapper --unset PYTHONPATH to isolate it from the host Python environment.

When consumed as a buildInput in another flake's devShell, other
Python-based packages (azure-cli, awscli2, pipx) pollute PYTHONPATH
with python3.13 site-packages. deepwork's python3.11 interpreter then
loads incompatible native extensions (e.g. cryptography built for 3.13),
causing "undefined symbol: PyErr_GetRaisedException" on MCP server start.

Wrap the deepwork binary with makeWrapper --unset PYTHONPATH to isolate
it from the host Python environment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Nix flake package output so deepwork runs with an isolated Python environment when used as a dependency in other flakes’ devShells, preventing incompatible PYTHONPATH leakage from other Python versions.

Changes:

  • Wraps the deepwork executable using makeWrapper --unset PYTHONPATH to avoid host PYTHONPATH pollution.
  • Replaces the package output from a full mkVirtualEnv result to a minimal wrapper derivation exposing only bin/deepwork.
  • Adds detailed inline documentation explaining the cross-Python native extension failure mode this addresses.

@ncrmro ncrmro merged commit 3540853 into main Feb 18, 2026
10 checks passed
@ncrmro ncrmro deleted the fix/wrap-pythonpath branch February 18, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant